package com.mallcloud.mall.app.api.entity.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@ApiModel(value = "WxPay2NotifyVO", description = "微信2统一支付")
@Data
public class WxPay2NotifyVO implements Serializable {
	private static final long serialVersionUID = 1L;

	private static final String SUCCESS_CODE = "SUCCESS";

	@ApiModelProperty("请求返回code")
	@JSONField(name = "return_code")
	@JsonProperty(value = "return_code")
    private String returnCode;

	@ApiModelProperty("请求返回消息")
	@JSONField(name = "return_msg")
	@JsonProperty(value = "return_msg")
    private String returnMsg;

	@JsonIgnore
	@JSONField(serialize = false)
	public Boolean isSuccess(){
		return SUCCESS_CODE.equals(this.returnCode);
	}

	@ApiModelProperty("应用编号")
	@JSONField(name = "appid")
	@JsonProperty(value = "appid")
	private String appId;

	@JsonProperty("bank_type")
	@JSONField(name = "bank_type")
	private String bankType;

	@JsonProperty("cash_fee")
	@JSONField(name = "cash_fee")
	private String cashFee;

	@JsonProperty("device_info")
	@JSONField(name = "device_info")
	private String deviceInfo;

	@JsonProperty("fee_type")
	@JSONField(name = "fee_type")
	private String feeType;

	@JsonProperty("is_subscribe")
	@JSONField(name = "is_subscribe")
	private String isSubscribe;

	@JsonProperty("mch_id")
	@JSONField(name = "mch_id")
	private String mchId;

	@JsonProperty("nonce_str")
	@JSONField(name = "nonce_str")
	private String nonceStr;

	@JsonProperty("openid")
	@JSONField(name = "openid")
	private String openId;

	@JsonProperty("out_trade_no")
	@JSONField(name = "out_trade_no")
	private String outTradeNo;

	@JsonProperty("sign")
	@JSONField(name = "sign")
	private String sign;

	@ApiModelProperty("支付时间yyyyMMddHHmmss")
	@JsonProperty("time_end")
	@JSONField(name = "time_end")
	private String timeEnd;

	@JsonProperty("total_fee")
	@JSONField(name = "total_fee")
	private String totalFee;

	@JsonProperty("transaction_id")
	@JSONField(name = "transaction_id")
	private String transactionId;

	@JsonProperty("trade_type")
	@JSONField(name = "trade_type")
	private String tradeType;
}
